package com.twu.biblioteca.customer;

import java.util.Vector;

public class Customers {
    private Vector<Customer> customers;

    public Customers() {
        customers = new Vector<Customer>();
    }

    public Vector<Customer> getCustomers() {
        return customers;
    }

    public void addCustomer(Customer customer) {
        customers.addElement(customer);
    }

    public Customer checkCustomerAccount(String libraryNumber,String password) {
        for(int i = 0; i < customers.size(); i++) {
            if(customers.elementAt(i).getLibraryNumber().equals(libraryNumber)&& customers.elementAt(i).getPassword().equals(password))
                return customers.elementAt(i);
        }
        return null;
    }
}
